<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@include file= "/WEB-INF/pages/base/commImportPage.jsp" %><html>
<head>
<title>内检测任务管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="${resourcePath}tags/bootstrap/bootstrap.css">

<link rel="stylesheet" type="text/css" href="${resourcePath}css/comm/Package.css">
<link rel="stylesheet" type="text/css" href="${resourcePath}css/comm/paging.css">
<link rel="stylesheet" type="text/css" href="${resourcePath}css/insp.css"> 
<link rel="stylesheet" type="text/css" href="${resourcePath}tags/laydate/need/laydate.css">
<link rel="stylesheet" type="text/css" href="${resourcePath}tags/laydate/skins/default/laydate.css">

<script src="${resourcePath}js/comm/jquery.js"></script>
<script src="${resourcePath}js/comm/build.js"></script>
<script src="${resourcePath}tags/bootstrap/bootstrap.min.js"></script>
<script src="${resourcePath}tags/laydate/laydate.js"></script>
<script src="${resourcePath}tags/dateTag.js"></script>

<script src="${pageContext.request.contextPath}/js/jquery.page.js"></script>
<script src="${pageContext.request.contextPath}/js/insp/task/taskManager.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.page.js"></script>
<script src="${pageContext.request.contextPath}/js/insp/inspresult/util.js"></script>
</head>

<body class="body-pad" style="padding-bottom: 100px;">
<input type="hidden" id="pagePath" value="${pageContext.request.contextPath}"/>
<input type="hidden" id="resourcePath" value="${resourcePath}"/>
<div class="html-header" style="background-color:white">
	
   <p class="header-title"><em></em>内检测任务管理</p>
</div>
<div class="container-fluid warp insp-container">
    <div class="row-fluid  bg-white1">
        <div class="main clearFix">
            <div class="se-bt clearFix">
                <div class="sel w410">
                        <div class="dropdown-list" style="float:left">
                        <div class="drop-list drop-list-min">
                            <div class="checked " style="width:270px;height:28px;" id="lineDiv">
                                <a href="javascript:void(0);" id="gdmc">管道名称</a>
                                <span class="down-span"></span>
                            </div>
                        </div>
                        <ul class="select select-min none" style="width:294px;">
	                        <c:forEach items="${requestScope.pipeLine}" var="line">
	                        	<li onclick="getInspSegment('${line.id}')" ><a href="javascript:void(0);" id="${line.id }" >${line.name}</a></li>
	                        </c:forEach>
                        </ul>
                    </div>
                </div>
                <div class="sel w410">
                    <div class="dropdown-list" style="float:left">
                        <div class="drop-list drop-list-min">
                            <div class="checked " style="width:270px;height:28px;" id="segmentDiv">
                                <a href="javascript:void(0);" id="jcgdmc">检测管段名称</a>
                                 <span class="down-span"></span>
                            </div>
                        </div>
                        <ul class="select select-min none" style="width:294px;" id="inspSegment">
                        </ul>
                    </div>
                </div>
                 <div style="clear:both"></div>
                <div class="sel w410">
                   <div class="dropdown-list" style="float:left" data-name='taskId'>
                        <div class="drop-list drop-list-min">
                            <div class="checked " style="width:270px;height:28px;" >
                                <a href="javascript:void(0);" id="jcrwmc">检测任务名称</a>
                                 <span class="down-span"></span>
                            </div>
                        </div>
                        <ul class="select select-min none selectTask" style="width:294px;" >
                        </ul>
                    </div>
                </div>
                <div style="clear:both"></div>
                <div class="sel w410">
                    <span class="nn">创建开始时间:</span>
                    <span class="time" ><input id="begTime" readonly onkeyup="noPermitInput(event,'begTime');" onclick="laydate({format: 'YYYY-MM-DD'})" class="laydate-icon"/><em></em></span>
                </div>
                <div class="sel w410">
                    <span class="nn">创建结束时间:</span>
                    <span class="time" ><input id="endTime" readonly onkeyup="noPermitInput(event,'endTime');" onclick="laydate({format: 'YYYY-MM-DD'})" class="laydate-icon"/><em></em></span>
                </div>
                <a class="btn btn-w100 btn-search-icon btn-h30" id="search"><em></em>查询</a>
            </div>
            <p class="tool pad20">
                <a href="#new_add" class="btn btn-w100 btn-add-icon btn-h30" onclick="getAdd();"><em></em>新建</a>
                <a href="#new_edit"  class="btn btn-w100 btn-edit-icon btn-h30" onclick="getModify();"><em></em>修改</a>
                <a href="javascript:;" class="btn btn-w100 btn-del-icon btn-h30" onclick="deleteFun('mutiCheck');"><em></em>删除</a>
                <a href="javascript:;" class="btn btn-w100 btn-public-icon btn-h30" onclick="publishFun('mutiCheck');"><em></em>发布</a>
            </p>
            <div class="l-r clearFix pad20">
                <div class="left">
                    <div class="info-header clearFix">
                        <ul class="ul-header">
                            <li class="w5">
                                <span class="Check-Box allBox"><input type="checkbox" name="parentSelect" /></span>
                            </li>
                            <li class="w20">任务名称</li>
                            <li class="w10">管道名称</li>
                            <li class="w10">发球点</li>
                            <li class="w10">收球点</li>
                            <li class="w10">创建时间</li>
                            <li class="w10">创建人</li>
                            <li class="w10">状态</li>
                            <li class="w15 no-right">删除/发布</li>
                        </ul>
                        <div id="searchBody">
                       		<c:if test="${empty requestScope.main}">
                           		暂时没有数据
                        	</c:if>
                        <c:if test="${not empty requestScope.main}">
	                        <c:forEach var="ps" items="${requestScope.main}" varStatus="status">
	                        	<%-- <input type="hidden" value="${ps.ID }"/> --%>
		                        <div class="info-tr">
		                            <ul class ="<c:if test="${status.index%2 eq 0}">ul-header bg-white</c:if> <c:if test="${status.index%2 ne 0}">ul-header bg-second</c:if>">
		                                <li class="w5"><span class="Check-Box"><input type="checkbox" id="${ps.ID }" class="${ps.ID }" name="childSelect"/></span></li>
		                                <li class="w20">${(not empty ps.TASKNAME && "" ne fn:trim(ps.TASKNAME)) ? ps.TASKNAME: '-'}</li>
		                                <li class="w10">${(not empty ps.LINENAME && "" ne fn:trim(ps.LINENAME)) ? ps.LINENAME: '-'}</li>
		                                <li class="w10">${(not empty ps.FROMPIG && "" ne fn:trim(ps.FROMPIG)) ? ps.FROMPIG: '-'}</li>
		                                <li class="w10">${(not empty ps.TOPIG && "" ne fn:trim(ps.TOPIG)) ? ps.TOPIG: '-'}</li>
		                                <li class="w10">
		                                	<c:if test="${empty ps.CREATEDATE}">
				                                -
		                                   </c:if>
	                                       <c:if test="${not empty ps.CREATEDATE}">
	                                           <fmt:formatDate value="${ps.CREATEDATE}" pattern="yyyy-MM-dd"/>
	                                       </c:if>
		                                </li>
		                                <li class="w10">${(not empty ps.CREATEUSER && "" ne fn:trim(ps.CREATEUSER)) ? ps.CREATEUSER: '-'}</li>
		                                <li class="w10">
		                                	<!-- 状态  -->
		                                	<c:if test="${empty ps.STAUS}">
				                                -
		                                   </c:if>
		                                   <c:if test="${'1' == ps.STAUS}">
				                                                               未发布
		                                   </c:if>
		                                   <c:if test="${'2' == ps.STAUS}">
				                               	已发布
		                                   </c:if>
		                                   <c:if test="${'3' == ps.STAUS}">
				                               	 进行中
		                                   </c:if>
		                                   <c:if test="${'4' == ps.STAUS}">
				                                                                 已完成
		                                   </c:if>
		                                </li>
		                                <li class="w15 no-right">
		                                  <a href="javascript:;" onclick="deleteFun('${ps.ID}');" class="delet"><img src="${resourcePath}/images/comm/del.png" alt=""/></a>
		                                  <a href="javascript:;" onclick="publishFun('${ps.ID}');" class="public"><img src="${resourcePath}/images/comm/icon1_07.png" alt=""/></a>
		                                </li>
		                            </ul>
		                        </div>
	                        </c:forEach>
                        </c:if>
                        </div>
                    </div>
                    
                    <c:if test="${ empty requestScope.main}">
                      		<div class="no-data" id="noDataImg">
                             	<img src="${resourcePath}/images/pig/no-data.png" alt=""/>
                        	</div> 
                        	<div class="paging-footer clearFix none " id="commonsPage">
                   			</div>
                      </c:if> 
                     <c:if test="${not empty requestScope.main}"> 
                    		 <div class="no-data none" id="noDataImg">
                             <img src="${resourcePath}/images/pig/no-data.png" alt=""/>
                        	</div>  
                           	<div class="paging-footer clearFix " id="commonsPage">
                   			</div>
                    </c:if> 
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 新增 开始-->
<div id="new_add" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="addClose();"></button>
        <h3 class="PopupTitle">新建检测任务</h3>
    </div>
    <div class="modal-body">
    	<div class="Popup" >
   		 	<div class="sel w410">
                   <span class="nn3">检测任务名称:</span>
                   <input type="text" class="input-name bg-grey" id="inspTaskName"/>
            </div>
    	</div>
        <div style="clear:both"></div>
        <div class="Popup">
             <span class="nn">管道名称:</span>
             <div class="dropdown-list" style="float:left">
                 <div class="drop-list drop-list-min">
                     <div class="checked" style="width:270px;height:28px;" id="inspLineDiv">
                         <a href="javascript:void(0);">管道名称</a><span></span>
                     </div>
                 </div>
                 <ul class="select select-min none" style="width:294px;" id="addInspLineDiv">
                 	<c:forEach items="${requestScope.pipeLine}" var="line">
                       <li onclick="getAddInspSegment('${line.id}')" ><a href="javascript:void(0);" id="${line.id }" >${line.name}</a></li>
                     </c:forEach>
                 </ul>
             </div>
        </div>
        <div class="Popup">
                <span class="nn3">检测管段名称:</span>
                <div class="dropdown-list" style="float:left">
                    <div class="drop-list drop-list-min">
                        <div class="checked" style="width:270px;height:28px;" id="inspSegmentDiv">
                            <a href="javascript:void(0);">检测管段名称</a><span></span>
                        </div>
                    </div>
                    <ul class="select select-min none" style="width:294px;" id="addInspSegment">
                    </ul>
                </div>
            </div>
        <div style="clear:both"></div>
        <div class="checkbox-div p">
                <span class="check-name" style="width:87px">检测工具 :</span>
                <div class="check-clip" style="width:80%" id="inspToolDiv">
                       
                </div>
            </div>
        <div style="clear:both"></div>
        <p class="p-t01">选择跟踪点:</p>
        
        <div id="pointDiv">
	       
        </div>
        
    </div>
    <div class="modal-footer">
        <button class="btn btn-w100 btn-save-icon btn-h30" onclick="saveTask();" style="top:-25px"><em></em>保存</button>
    </div>
</div>
<!-- 新增 结束 -->

<!-- 修改开始 -->
<div id="new_edit" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <input id="modTaskId" type="hidden" value=""/>
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h3 class="PopupTitle">修改检测任务</h3>
    </div>
    <div class="modal-body">
    	<div class="Popup" >
   		 	<div class="sel w410">
                   <span class="nn3">检测任务名称:</span>
                   <input type="text" class="input-name bg-grey" id="modTaskName"/>
            </div>
    	</div>
        <div style="clear:both"></div>
        <div class="Popup">
            <span class="nn">管道名称:</span>
            <div class="dropdown-list" style="float:left">
                <div class="drop-list drop-list-min">
                    <div class="checked" style="width:270px;height:28px;" id="modPipeLineDiv">
                    </div>
                </div>
                <ul class="select select-min none" style="width:294px;" id="modPipeLineAllDiv">
                </ul>
            </div>
        </div>
        <div class="Popup">
            <span class="nn3">检测管段名称:</span>
            <div class="dropdown-list" style="float:left">
                <div class="drop-list drop-list-min">
                    <div class="checked" style="width:270px;height:28px;" id="modInspSegmentDiv">
                    </div>
                </div>
                <ul class="select select-min none" style="width:294px;" id="modInspSegmentAllDiv">
                </ul>
            </div>
        </div>
        <div style="clear:both"></div>
        <div class="checkbox-div p">
            <span class="check-name" style="width:87px">检测工具 :</span>
            <div class="check-clip" style="width:80%">
            	<div id="modToolDiv">
            	
            	</div>
            </div>
        </div>
        <div style="clear:both"></div>
        <p class="p-t01">选择跟踪点:</p>
        <div id="modTrackPointDiv">
	       
        </div>
        
        
    </div>
    <div class="modal-footer">
       <!--  <button class="btn btn-w100 btn-save-icon btn-h30" data-dismiss="modal" aria-hidden="true"><em></em>保存</button> -->
       <button class="btn btn-w100 btn-save-icon btn-h30" style="top:-25px" onclick="saveModTask();"><em></em>保存</button>
    </div>
</div>
<!-- 修改结束 -->

<input type="hidden" id="taskNameHiddenId" value="" />
<input type="hidden" id="lineHiddenId" value="" />
<input type="hidden" id="segmentHiddenId" value="" />
<input type="hidden" id="begTimeHiddenId" value="" />
<input type="hidden" id="endTimeHiddenId" value="" />

<input type="hidden" id="getFromPig" value="" />
<input type="hidden" id="getToPig" value="" />
</body>
<script>
var map={"current":1,"pageCount":10,"totalSize":"${pageTotal}","fillDiv":"#searchBody",
        "url":"${pageContext.request.contextPath}/insp/inspTaskManager/findByCondition.json"};
commonPages(map);
</script>
<script src="${resourcePath}js/comm/base_v3.0.js"></script>
</html>